#BWE == BWorld Engine.
#this is make file for BWE project.
#the target is libBWE.so examples and plugins.

TARGET = libBWE.so

ifdef LIB_STATIC
	LIB_TYPE = -static
else
	LIB_TYPE = -shared
endif

OUT_DIR = ./out/

PRO_DIR = ./
OBJ_DIR = $(PRO_DIR)object/
INC_DIR = $(PRO_DIR)include/
SRC_DIR = $(PRO_DIR)source/

GPATH = ./object
VPATH = ./source
CPPFLAGS = -fPIC -I$(INC_DIR) -I/usr/local/include/freetype2

OBJECTS_3D = \
	BRender.o\
	BMesh.o\
	BNode.o\
	BLight.o\
	BCamera.o\
	BControl.o\
	BSphereControl.o\
	BState.o\
	BMaterial.o\
	BTexture.o\
	BDisplay.o\
	BProgram.o\
	BShader.o\
	BShape.o\
	BGeometry.o\
	BCube.o\
	BCone.o\
	BSphere.o\
	BGeoSphere.o\
	BCylinder.o\
	BTorus.o\
	BPrimitive.o\
	BScene.o\
	BSurface.o\
	BPicker.o\
	BPickItem.o\
	member_BMesh.o\
	member_BNode.o\
	member_BLight.o\
	member_BCamera.o\
	member_BControl.o\
	member_BSphereControl.o\
	member_BState.o\
	member_BMaterial.o\
	member_BTexture.o\
	member_BShape.o\
	member_BGeometry.o\
	member_BRender.o\
	member_BPrimitive.o\
	member_BDisplay.o\
	member_BCone.o\
	member_BCylinder.o\
	member_BProgram.o\
	member_BCube.o\
	member_BTorus.o\
	member_BSphere.o\
	member_BGeoSphere.o\
	member_BScene.o\
	member_BSurface.o\
	member_BShader.o\
	member_BUniform.o\
	member_BPicker.o\
	member_BPickItem.o\
	
OBJECTS_GUI = \
	BScreen.o\
	BPainter.o\
	BWidget.o\
	BLayout.o\
	BSpacer.o\
	BSpring.o\
	BViewer.o\
	BButton.o\
	BEvent.o\
	BMenu.o\
	BMenuBar.o\
	BDrag.o\
	BAction.o\
	BDialog.o\
	BFileDialog.o\
	BColorDialog.o\
	BMessageBox.o\
	BSplitter.o\
	BMainWindow.o\
	BAudioEvent.o\
	BMouseEvent.o\
	BChangeEvent.o\
	BFocusEvent.o\
	BKeyEvent.o\
	BCharEvent.o\
	BDragEvent.o\
	BComboBox.o\
	BCheckBox.o\
	BTextEdit.o\
	BSlider.o\
	BLineEdit.o\
	BSpinBox.o\
	BDoubleSpinBox.o\
	BLabel.o\
	BScrollArea.o\
	BScrollBar.o\
	BScrollWidget.o\
	BTabWidget.o\
	BProgressBar.o\
	BTreeWidget.o\
	BTreeItem.o\
	BListWidget.o\
	BListItem.o\
	BTableWidget.o\
	BTableItem.o\
	BGroupBox.o\
	BHBoxLayout.o\
	BVBoxLayout.o\
	BGridLayout.o\
	member_BScreen.o\
	member_BMenu.o\
	member_BSlider.o\
	member_BSpinBox.o\
	member_BDoubleSpinBox.o\
	member_BTabWidget.o\
	member_BScrollWidget.o\
	member_BMenuBar.o\
	member_BCheckBox.o\
	member_BTableWidget.o\
	member_BTableItem.o\
	member_BSplitter.o\
	member_BDialog.o\
	member_BFileDialog.o\
	member_BColorDialog.o\
	member_BMessageBox.o\
	member_BTreeWidget.o\
	member_BTreeItem.o\
	member_BListWidget.o\
	member_BListItem.o\
	member_BComboBox.o\
	member_BAction.o\
	member_BLabel.o\
	member_BScrollArea.o\
	member_BScrollBar.o\
	member_BLineEdit.o\
	member_BTextEdit.o\
	member_BEvent.o\
	member_BPainter.o\
	member_BButton.o\
	member_BViewer.o\
	member_BSpacer.o\
	member_BSpring.o\
	member_BLayout.o\
	member_BWidget.o\
	member_BGroupBox.o\
	member_BHBoxLayout.o\
	member_BVBoxLayout.o\
	member_BGridLayout.o\
	member_BProgressBar.o\
	member_BDrag.o\
	member_BMainWindow.o\

OBJECTS_CORE = \
	BApplication.o\
	BSystem.o\
	BFont.o\
	BGlyph.o\
    	BOpenGL.o\
	BStyle.o\
	BTimer.o\
	BCursor.o\
	BDisk.o\
	BEntry.o\
	BFile.o\
	BStream.o\
	BBuffer.o\
	BFileInfo.o\
	BFolder.o\
	BIcon.o\
	BImage.o\
	BLibrary.o\
	BClock.o\
	BObject.o\
	BRawSocket.o\
	BReadWrite.o\
	BSocket.o\
	BTcpServer.o\
	BTcpSocket.o\
	BThread.o\
	BUdpSocket.o\
	BAudioInput.o\
	BAudioOutput.o\
	BXmlNode.o\
	BXmlDocument.o\
	member_BClock.o\
	member_BEntry.o\
	member_BTimer.o\
	member_BAudioInput.o\
	member_BAudioOutput.o\
	member_BObject.o\
	member_BImage.o\
	member_BDisk.o\
	member_BFile.o\
	member_BFolder.o\
	member_BLibrary.o\
	member_BRawSocket.o\
	member_BSocket.o\
	member_BCursor.o\
	member_BTcpServer.o\
	member_BTcpSocket.o\
	member_BUdpSocket.o\
	member_BStyle.o\
	member_BFont.o\
	member_BIcon.o\
	member_BThread.o\
	member_BBuffer.o\
	member_BXmlNode.o\
	member_BXmlDocument.o\
	
OBJECTS_INTERNAL = \
	IWindow.o\
	IFontFamily.o\
	IGlobal.o\
	ISockets.o\
	IComboBoard.o\
	IPixmap.o\
	IReader.o\
	IWriter.o\
	IGLState.o\
	IStyleDriver.o\
	IWindow_X11.o\
	IWindow_Win.o\

OBJECTS = $(OBJECTS_CORE) $(OBJECTS_GUI) $(OBJECTS_3D) $(OBJECTS_INTERNAL)

#this is libBWE.so target
$(OUT_DIR)$(TARGET):$(OBJECTS)
	g++ -o $@ -fPIC -shared $(OBJECTS) -g -pthread -lGL -lX11 -lrt -lfreetype


.PHONY:clean
clean:
	-rm *.o
	-rm $(OUT_DIR)$(TARGET)

